#!/usr/bin/python
# -*- coding: utf-8 -*-
#file_op.py
#version 0.1  edited by lingyue.wkl 2011-10-1 11:52:11

#this script is userd to operate the file

import socket,urllib

def send_msg(host,port,msg):
  s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  s.sendto(msg,(host,port))

def get_html_doc(url):
  return urllib.urlopen(url).read()

send_msg("localhost",8080,"this is a msg sent by socket")
print get_html_doc("http://www.baidu.com")

